package net.xdclass.component;

import net.xdclass.strategy.ShardingDBConfig;
import net.xdclass.strategy.ShardingTableConfig;
import net.xdclass.util.CommonUtil;
import org.springframework.stereotype.Component;

@Component
public class ShortLinkComponent {

	public   String getShortLink(String url){
		String code = CommonUtil.encodeTobase62(CommonUtil.getMurmur(url));
		String shortLink = ShardingDBConfig.getDBPrefix(url) + code + ShardingTableConfig.gettableSuffix(url);
		return shortLink;
	}

}
